package com.cysyz.mylib.io.filenamegenerator.impl;

import com.cysyz.mylib.io.filenamegenerator.IFileNameGenerator;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class FileNameGeneratorTimeStamp implements IFileNameGenerator{

	public String generate(String srcFileName) {
		String timestamp = new SimpleDateFormat("yyyyMMddHHmmsss").format(new Date());
		StringBuilder retValue = new StringBuilder(timestamp);
		Random random = new Random();
		for (int i = 0 ; i < 5 ; i ++) {
			retValue.append(random.nextInt(9));
		}
		return timestamp;
	}

}
